 //退出登录
 function logout() {
    if(confirm("确认注销?")) {
        jQuery.ajax({
            url:"user/logout",
            type:"POST",
            data:{},
            success:function(result){
                if(result!=null && result.code==200) {
                    location.href = "/login.html";
                }
            }
            
        });
    }
}

//查询文章详情
function getArtDetail(id) {
    if(id=="") {
        alert("非法参数!");
        return;
    }
    jQuery.ajax({
        url:"art/detail",
        type:"POST",
        data:{"id":id},
        success:function(result) {
            if(result!=null && result.code==200){
                jQuery("#title").html(result.data.title);
                jQuery("#updatetime").html(result.data.updatetime);
                jQuery("#rcount").html(result.data.rcount);
                initEdit(result.data.content);
                showUser(result.data.uid);
            } else {
                alert("查询失败!");
            }
        }
    });

}

  //获取当前url参数的公共方法
  function getUrlValue(key) {

    var params = location.search;
    if(params.length>1) {
        params = location.search.substring(1);
        var paramArr = params.split("&");
        for(var i = 0;i<paramArr.length;i++) {
            var kv = paramArr[i].split("=");
            if(kv[0]==key) {
                return kv[1];
            }
        }
        return "";
    }
    
}